#pragma once
#include "qstring.h"
#include "graph.h"

class DataEntry {
public:
	enum EntryType {Airport, Route};

	virtual EntryType getType() = 0;
	virtual QString toString() = 0;
};

class AirportEntry: public DataEntry, public Node {
public:
	AirportEntry(int id, 
				const QString& name, 
				const QString& city, 
				const QString& country, 
				const QString& iata, 
				const QString& icao, 
				double latitude, 
				double longitude, 
				double altitude, 
				double timezone, 
				const QString& dst);
	EntryType	getType();
	QString		toString();
	QString		getName() {return name;};
	QString		getCity() {return city;};
	QString		getCountry() {return country;};
//private:
	int			airport_ID;
	QString		name;
	QString		city;
	QString		country;
	QString		IATA;
	QString		ICAO;
	QString		DST;
	double		latitude;
	double		longitude;
	double		altitude;
	double		timezone;
};

class RouteEntry: public DataEntry, public Edge {
public:
	RouteEntry(	const QString& airline, 
				int airline_id, 
				const QString& origin, 
				int origin_id, 
				const QString& destination, 
				int destination_id, 
				const QString& codeshare, 
				int stops, 
				const QString& equiment);
	EntryType	getType();
	QString		toString();

//private:
	QString		airline;
	QString		origin;
	QString		destination;
	QString		codeshare;
	QString		equipment;
	int			airline_ID;
	int			origin_ID;
	int			destination_ID;
	int			stops;
};
